﻿using System;
using System.Collections.Generic;
using SoftSource.Ria;
using SoftSource.Timecard.Web.Data;

namespace SoftSource.Timecard.Entry.Model
{
    public interface IModelEntities : IDisposable
    {
        #region Static
        ReadOnlyEntityWrapper<Role> Roles { get; }
        ReadOnlyEntityWrapper<Report> Reports { get; }
        ReadOnlyEntityWrapper<UserType> UserTypes { get; }
        ReadOnlyEntityWrapper<ProjectType> ProjectTypes { get; }
        ReadOnlyEntityWrapper<RevenueType> RevenueTypes { get; }
        ReadOnlyEntityWrapper<BillingState> BillingStates { get; }
        ReadOnlyEntityWrapper<ProjectStatus> ProjectStatuses { get; }
        ReadOnlyEntityWrapper<BillingFrequency> BillingFrequencies { get; }
        #endregion Static

        #region Read-Only
        ReadOnlyEntityWrapper<UserSummary> UserSummaries { get; }
        ReadOnlyEntityWrapper<ProjectSummary> ProjectSummaries { get; }
        ReadOnlyEntityWrapper<CategorySummary> CategorySummaries { get; }
        ReadOnlyEntityWrapper<ProjectCategorySummary> ProjectCategorySummaries { get; }
        #endregion Read-Only

        #region Read-Write
        EntityWrapper<EntryLog> Entries { get; }
        #endregion Read-Write     
    }

    public interface IModelQueries
    {
        IObservable<Unit> LoadData();
        IObservable<IEnumerable<EntryLog>> GetEntriesForCurrentUserByDateRange(DateTime start, DateTime end);
        IObservable<IEnumerable<EntryLog>> GetFilteredEntries(
            int? projectID,
            int? userID,
            DateTime? startDate,
            DateTime? endDate);
    }

    public interface IModel : IModelEntities, IModelQueries
    {
    }
}
